<% layout('layout/layout') %>
<% block('header').append(`<style>
</style>`)%>
<div id="pages" class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">单页管理</h3>
                <div class="box-tools">
                    <a class="btn  btn-sm btn-success" href="add">添加+</a>
                    <!--<div class="input-group input-group-sm" style="width: 150px;">-->
                    <!--<input type="text" name="table_search" class="form-control pull-right" placeholder="Search">-->

                    <!--<div class="input-group-btn">-->
                    <!--<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>-->
                    <!--</div>-->
                    <!--</div>-->
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-bordered table-hover">
                    <tbody>
                    <tr>
                        <th>单页标题</th>
                        <th>单页图片</th>
                        <th>路径名</th>
                        <th>是否有效</th>
                        <th>操作</th>
                    </tr>
                    <% pages.forEach(function(item){%>
                    <tr>
                        <td><%=item.title%></td>
                        <td><%=item.imgUrl || '无'%></td>
                        <td><%=item.path %></td>
                        <td><%=item.isValid ?'有效':'无效'%></td>
                        <td>
                            <a class="btn  btn-sm btn-success" href="add?update=<%=item._id %>">修改</a>
                            <a class="btn btn-delete  btn-sm btn-danger" data-id="<%=item._id%>" data-url="<%=assetsPath %>/pages/delete" href="javascript:void(0)">删除</a>
                        </td>
                    </tr>
                    <% }) %>
                    </tbody>
                </table>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
        <div class="j_pager" data-page="<%=page %>"  data-count="<%=count %>"></div>
    </div>

</div>
<% block('footer').append(`<script src="${assetsPath}/js/uploadImg.js"></script>`); %>
<% block('footer').append(`<script src="${assetsPath}/js/jPager.js" ></script>`); %>
<% block('footer').append(`<script>
    jQuery(function() {
    	$('.j_pager').pager()
    	$.delBtn('#pages','你确定要删掉这个页面么')
    })

</script>`)%>